package com.hudson.namesrv.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.net.InetAddress;
import java.net.UnknownHostException;

/**
 * @Author: 渔小鲤
 * @DateTime: 2025/7/12 20:31
 **/
public class InetAddressUtil {
    private static final Logger logger = LoggerFactory.getLogger(InetAddressUtil.class);

    public static InetAddress get(){
        InetAddress localHost = null;
        try {
            localHost = InetAddress.getLocalHost();
        } catch (UnknownHostException e) {
            logger.error("寻找主机失败");
        }
        return localHost;
    }
}
